package com.tbit.uqbike.object.pojo.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.tbit.uqbike.annos.Excel;
import lombok.Data;

import java.util.Date;

/**
 * 分账用户提现历史
 *
 * @Author:BUGTian
 * @DATE: 2022/6/1
 */
@Data
public class SubAccountWithdrawalLogVO {


    /**
     * 提现请求订单号
     */
    private String withdrawalOrderNO;

    /**
     * 品牌id
     */
    private Integer accountId;

    /**
     * 操作时间
     */
    @Excel(name = "操作时间", dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 1)
    private Date addTime;

    /**
     * 操作人id
     */
    private Integer accountUserId;

    /**
     * 提现平台名称
     */
    private String withdrawalPlatform;

    /**
     * 操作人手机号
     */
    @Excel(name = "操作人手机号", sort = 2)
    private String accountUserPhone;

    /**
     * 分账账户id
     */
    private Integer subAccountId;

    /**
     * 银行卡号
     */
    @Excel(name = "银行卡号", sort = 3)
    private String bankCardNumber;

    /**
     * 提现金额（单位：分）
     */
    private Integer withdrawalMoney;

    /**
     * 提现进度（1=提现中，2=提现成功,3=提现失败）
     */
    @Excel(name = "提现进度", readConverterExp = "1=提现中,2=提现成功,3=提现失败", sort = 5)
    private Integer schedule;

    /**
     * 提现类型（0=自动提现，1=手动提现）
     */
    @Excel(name = "提现类型", readConverterExp = "0=自动提现,1=手动提现", sort = 6)
    private Integer withdrawalType;

    /**
     * 分账账号
     */
    @Excel(name = "分账账号", sort = 0)
    private String nickName;

    /**
     * 单位为元，保留两位小数的提现金额
     */
    @JSONField(serialize = false)
    @Excel(name = "提现金额", sort = 4)
    private String withdrawalMoneyYuan;

    /**
     * 备注
     */
    @Excel(name = "备注", sort = 7)
    private String remark;

    /**
     * 提现金额导出单位转换为元 保留两位小数
     */
    public void unitConversion() {
        //分转为元,保留两位小数
        this.withdrawalMoneyYuan = String.format("%.2f", ((double) withdrawalMoney / 100D));
    }

}
